package cn.edu.scau.cmi.wujiaming.experiment5.client;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class ConsistentComponentClient extends Application {
	private static String title = "实验5-一致组合模式";
	
	@Override
	public void start(Stage primaryStage) {
		try {
			Parent root = FXMLLoader.load(getClass().
					getResource("/cn/edu/scau/cmi/wujiaming/experiment5/consistent/ConsistentComponentScene.fxml"));
			primaryStage.setScene(new Scene(root));
			primaryStage.setTitle(title);
			primaryStage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
	}
	
	public static void setTitle(String _title) {
		ConsistentComponentClient.title = _title;
	}
	
	/**
	 * 用于综合性实验打开界面
	 */
	public void openNewView() {
		Stage stage = new Stage();
		try {
			Parent root = FXMLLoader.load(getClass().
					getResource("/cn/edu/scau/cmi/wujiaming/experiment5/consistent/ConsistentComponentScene.fxml"));
			stage.setScene(new Scene(root));
			stage.setTitle(title);
			stage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}